package com.sjsu.CMPE226.normalized.jdbc.data;

import java.util.Date;

public class Observation {
	private long observationId;
	private String stationId;
	private Date observationsDateTime;
	private float temperature;
	private float windSpeed;
	private float direction;
	private float gust;
	private float seaLevelPressure;
	private float altimeter;
	private float dewPoint;
	private float relativeHumidity;
	private float weatherCode;
	private float P24I;

	/**
	 * @return the observationId
	 */
	public long getObservationId() {
		return observationId;
	}

	/**
	 * @param observationId
	 *            the observationId to set
	 */
	public void setObservationId(long observationId) {
		this.observationId = observationId;
	}

	/**
	 * @return the observationsDateTime
	 */
	public Date getObservationsDateTime() {
		return observationsDateTime;
	}

	/**
	 * @param observationsDateTime
	 *            the observationsDateTime to set
	 */
	public void setObservationsDateTime(Date observationsDateTime) {
		this.observationsDateTime = observationsDateTime;
	}

	/**
	 * @return the stationId
	 */
	public String getStationId() {
		return stationId;
	}

	/**
	 * @param stationId
	 *            the stationId to set
	 */
	public void setStationId(String stationId) {
		this.stationId = stationId;
	}

	/**
	 * @return the temperature
	 */
	public float getTemperature() {
		return temperature;
	}

	/**
	 * @param temperature
	 *            the temperature to set
	 */
	public void setTemperature(float temperature) {
		this.temperature = temperature;
	}

	/**
	 * @return the windSpeed
	 */
	public float getWindSpeed() {
		return windSpeed;
	}

	/**
	 * @param windSpeed
	 *            the windSpeed to set
	 */
	public void setWindSpeed(float windSpeed) {
		this.windSpeed = windSpeed;
	}

	/**
	 * @return the direction
	 */
	public float getDirection() {
		return direction;
	}

	/**
	 * @param direction
	 *            the direction to set
	 */
	public void setDirection(float direction) {
		this.direction = direction;
	}

	/**
	 * @return the gust
	 */
	public float getGust() {
		return gust;
	}

	/**
	 * @param gust
	 *            the gust to set
	 */
	public void setGust(float gust) {
		this.gust = gust;
	}

	/**
	 * @return the seaLevelPressure
	 */
	public float getSeaLevelPressure() {
		return seaLevelPressure;
	}

	/**
	 * @param seaLevelPressure
	 *            the seaLevelPressure to set
	 */
	public void setSeaLevelPressure(float seaLevelPressure) {
		this.seaLevelPressure = seaLevelPressure;
	}

	/**
	 * @return the altimeter
	 */
	public float getAltimeter() {
		return altimeter;
	}

	/**
	 * @param altimeter
	 *            the altimeter to set
	 */
	public void setAltimeter(float altimeter) {
		this.altimeter = altimeter;
	}

	/**
	 * @return the dewPoint
	 */
	public float getDewPoint() {
		return dewPoint;
	}

	/**
	 * @param dewPoint
	 *            the dewPoint to set
	 */
	public void setDewPoint(float dewPoint) {
		this.dewPoint = dewPoint;
	}

	/**
	 * @return the relativeHumidity
	 */
	public float getRelativeHumidity() {
		return relativeHumidity;
	}

	/**
	 * @param relativeHumidity
	 *            the relativeHumidity to set
	 */
	public void setRelativeHumidity(float relativeHumidity) {
		this.relativeHumidity = relativeHumidity;
	}

	/**
	 * @return the weatherCode
	 */
	public float getWeatherCode() {
		return weatherCode;
	}

	/**
	 * @param weatherCode
	 *            the weatherCode to set
	 */
	public void setWeatherCode(float weatherCode) {
		this.weatherCode = weatherCode;
	}

	/**
	 * @return the p24I
	 */
	public float getP24I() {
		return P24I;
	}

	/**
	 * @param p24i
	 *            the p24I to set
	 */
	public void setP24I(float p24i) {
		P24I = p24i;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + Float.floatToIntBits(P24I);
		result = prime * result + Float.floatToIntBits(altimeter);
		result = prime * result + Float.floatToIntBits(dewPoint);
		result = prime * result + Float.floatToIntBits(direction);
		result = prime * result + Float.floatToIntBits(gust);
		result = prime * result
				+ (int) (observationId ^ (observationId >>> 32));
		result = prime
				* result
				+ ((observationsDateTime == null) ? 0 : observationsDateTime
						.hashCode());
		result = prime * result + Float.floatToIntBits(relativeHumidity);
		result = prime * result + Float.floatToIntBits(seaLevelPressure);
		result = prime * result
				+ ((stationId == null) ? 0 : stationId.hashCode());
		result = prime * result + Float.floatToIntBits(temperature);
		result = prime * result + Float.floatToIntBits(weatherCode);
		result = prime * result + Float.floatToIntBits(windSpeed);
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Observation other = (Observation) obj;
		if (Float.floatToIntBits(P24I) != Float.floatToIntBits(other.P24I))
			return false;
		if (Float.floatToIntBits(altimeter) != Float
				.floatToIntBits(other.altimeter))
			return false;
		if (Float.floatToIntBits(dewPoint) != Float
				.floatToIntBits(other.dewPoint))
			return false;
		if (Float.floatToIntBits(direction) != Float
				.floatToIntBits(other.direction))
			return false;
		if (Float.floatToIntBits(gust) != Float.floatToIntBits(other.gust))
			return false;
		if (observationId != other.observationId)
			return false;
		if (observationsDateTime == null) {
			if (other.observationsDateTime != null)
				return false;
		} else if (!observationsDateTime.equals(other.observationsDateTime))
			return false;
		if (Float.floatToIntBits(relativeHumidity) != Float
				.floatToIntBits(other.relativeHumidity))
			return false;
		if (Float.floatToIntBits(seaLevelPressure) != Float
				.floatToIntBits(other.seaLevelPressure))
			return false;
		if (stationId == null) {
			if (other.stationId != null)
				return false;
		} else if (!stationId.equals(other.stationId))
			return false;
		if (Float.floatToIntBits(temperature) != Float
				.floatToIntBits(other.temperature))
			return false;
		if (Float.floatToIntBits(weatherCode) != Float
				.floatToIntBits(other.weatherCode))
			return false;
		if (Float.floatToIntBits(windSpeed) != Float
				.floatToIntBits(other.windSpeed))
			return false;
		return true;
	}

	
}